﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WJP.Domain;

namespace WJP.ManagedProperty
{
    /// <summary>
    /// 托管属性对象接口
    /// </summary>
    public interface IManagedPropertyObject
    {
        /// <summary>
        /// 获取属性值
        /// </summary>
        /// <param name="property">托管属性</param>
        /// <returns></returns>
        object GetProperty(IManagedProperty property);

        /// <summary>
        /// 获取属性值
        /// </summary>
        /// <typeparam name="TPropertyType">属性类型</typeparam>
        /// <param name="property">托管属性</param>
        /// <returns></returns>
        TPropertyType GetProperty<TPropertyType>(ManagedProperty<TPropertyType> property);

        /// <summary>
        /// 重置属性值
        /// </summary>
        /// <param name="property">托管属性</param>
        void ResetProperty(IManagedProperty property);

        /// <summary>
        /// 设置属性值
        /// </summary>
        /// <param name="property">托管属性</param>
        /// <param name="value">值</param>
        /// <returns></returns>
        object SetProperty(IManagedProperty property, object value);

        /// <summary>
        /// 加载属性值，不发生PropertyChanged事件
        /// </summary>
        /// <param name="property">托管属性</param>
        /// <param name="value">值</param>
        void LoadProperty(IManagedProperty property, object value);
    }
}
